package com.wzs.service.impl;

import com.wzs.bean.UserLoginLog;
import com.wzs.repository.impl.LogRepository;
import com.wzs.service.LogsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LogServiceImpl implements LogsService {

    @Autowired
    private LogRepository repository;

    //添加登录记录
    public void addLog(UserLoginLog log) {
        repository.save(log);
    }

    //根据id查找所有登录记录
    public List<UserLoginLog> getLogs(Integer uId) {
        return repository.ListByUserId(uId);
    }
}
